import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { NZ_I18N } from 'ng-zorro-antd/i18n';
import { zh_CN } from 'ng-zorro-antd/i18n';
import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';
import { FormsModule } from '@angular/forms';
import {  HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { IconsProviderModule } from './icons-provider.module';
import { NzLayoutModule } from 'ng-zorro-antd/layout';
import { NzMenuModule } from 'ng-zorro-antd/menu';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { UrlComponent } from './pages/url/url.component';
import { NzTableModule } from 'ng-zorro-antd/table';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { UrlPermissionComponent } from './pages/url-permission/url-permission.component';
import { NzTagModule } from 'ng-zorro-antd/tag';
import { NzAutocompleteModule } from 'ng-zorro-antd/auto-complete';
import { NzInputModule } from 'ng-zorro-antd/input';
import { NzTreeViewModule } from 'ng-zorro-antd/tree-view';
import { MenuComponent } from './pages/menu/menu.component';
import { MenuPermissionComponent } from './pages/menu-permission/menu-permission.component';
import { SysrolePermissionComponent } from './pages/sysrole-permission/sysrole-permission.component';
import { DataPermissionComponent } from './pages/data-permission/data-permission.component';
import { FilePermissionComponent } from './pages/file-permission/file-permission.component';
import { SysroleComponent } from './pages/sysrole/sysrole.component';
import { OrganizationComponent } from './pages/organization/organization.component';
import { RoleComponent } from './pages/role/role.component';
import { LevelComponent } from './pages/level/level.component';
import { GroupComponent } from './pages/group/group.component';
import { ModelAttributePermissionComponent } from './pages/model-attribute-permission/model-attribute-permission.component';
import { ModelAttributeComponent } from './pages/model-attribute/model-attribute.component';
import { ModelComponent } from './pages/model/model.component';
import { ModelPermissionComponent } from './pages/model-permission/model-permission.component';
import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
import { FileComponent } from './pages/file/file.component';
import { LogComponent } from './pages/log/log.component';
import { DictComponent } from './pages/dict/dict.component';
import { SerialNumberComponent } from './pages/serial-number/serial-number.component';
import { ConfigComponent } from './pages/config/config.component';
import { EmployeeComponent } from './pages/employee/employee.component';
import { AuthInterceptor } from './auth.interceptor';
import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
import { NzGridModule } from 'ng-zorro-antd/grid';
import { NzDividerModule } from 'ng-zorro-antd/divider';
import { NzCardModule } from 'ng-zorro-antd/card';
import { NzTabsModule } from 'ng-zorro-antd/tabs';
import { NzRadioModule } from 'ng-zorro-antd/radio';
import { NzModalModule } from 'ng-zorro-antd/modal';
import { NzFormModule } from 'ng-zorro-antd/form';
import { ReactiveFormsModule } from '@angular/forms';
import { NzSelectModule } from 'ng-zorro-antd/select';
import { SysroleSearchComponent } from './share/sysrole-search/sysrole-search.component';
import { IndexComponent } from './pages/index/index.component';
import { SetModelPermissionComponent } from './share/set-model-permission/set-model-permission.component';
import { SetDataPermissionComponent } from './share/set-data-permission/set-data-permission.component';
import { CheckDataPermissionComponent } from './share/check-data-permission/check-data-permission.component';
import { CheckModelPermissionComponent } from './share/check-model-permission/check-model-permission.component';
import { OrganizationSearchComponent } from './share/organization-search/organization-search.component';
import { NzMessageModule } from 'ng-zorro-antd/message';
import { RoleSearchComponent } from './share/role-search/role-search.component';
import { LevelSearchComponent } from './share/level-search/level-search.component';
import { EmployeeSearchComponent } from './share/employee-search/employee-search.component';
import { MenuSearchComponent } from './share/menu-search/menu-search.component';
import { UserSearchComponent } from './share/user-search/user-search.component';
import { SparrowAppComponent } from './pages/sparrow-app/sparrow-app.component';
import { DataPermissionManagementComponent } from './pages/data-permission-management/data-permission-management.component';
import { AppSearchComponent } from './share/app-search/app-search.component';
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
import { RoleTreeComponent } from './share/role-tree/role-tree.component';
import { LevelTreeComponent } from './share/level-tree/level-tree.component';
import { EmployeeTreeComponent } from './share/employee-tree/employee-tree.component';
import { EmployeeReportTreeComponent } from './share/employee-report-tree/employee-report-tree.component';
import { NzTimelineModule } from 'ng-zorro-antd/timeline';
import { NzCollapseModule } from 'ng-zorro-antd/collapse';
import { GroupSearchComponent } from './share/group-search/group-search.component';
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { PermissionSelectComponent } from './share/permission-select/permission-select.component';
import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select';
import { NzSwitchModule } from 'ng-zorro-antd/switch';
import { LoginComponent } from './pages/login/login.component';
import { ApiModule, BASE_PATH, Configuration, ConfigurationParameters } from 'sparrow-permission-lib';
import { ScopeComponent } from './pages/scope/scope.component';
import { ScopeSearchComponent } from './share/scope-search/scope-search.component';

registerLocaleData(zh);

@NgModule({
  declarations: [
    AppComponent,
    UrlComponent,
    UrlPermissionComponent,
    MenuComponent,
    MenuPermissionComponent,
    SysrolePermissionComponent,
    DataPermissionComponent,
    FilePermissionComponent,
    SysroleComponent,
    OrganizationComponent,
    RoleComponent,
    LevelComponent,
    GroupComponent,
    ModelAttributePermissionComponent,
    ModelAttributeComponent,
    ModelComponent,
    ModelPermissionComponent,
    FileComponent,
    LogComponent,
    DictComponent,
    SerialNumberComponent,
    ConfigComponent,
    EmployeeComponent,
    SysroleSearchComponent,
    IndexComponent,
    SetModelPermissionComponent,
    SetDataPermissionComponent,
    CheckDataPermissionComponent,
    CheckModelPermissionComponent,
    OrganizationSearchComponent,
    RoleSearchComponent,
    LevelSearchComponent,
    EmployeeSearchComponent,
    MenuSearchComponent,
    UserSearchComponent,
    SparrowAppComponent,
    DataPermissionManagementComponent,
    AppSearchComponent,
    RoleTreeComponent,
    LevelTreeComponent,
    EmployeeTreeComponent,
    EmployeeReportTreeComponent,
    GroupSearchComponent,
    PermissionSelectComponent,
    LoginComponent,
    ScopeComponent,
    ScopeSearchComponent,
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    HttpClientModule,
    BrowserAnimationsModule,
    IconsProviderModule,
    NzLayoutModule,
    NzMenuModule,
    NzTableModule,
    NzButtonModule,
    NzTagModule,
    NzAutocompleteModule,
    NzInputModule,
    NzTreeViewModule,
    NzCheckboxModule,
    NzBreadCrumbModule,
    NzGridModule,
    NzDividerModule,
    NzCardModule,
    NzTabsModule,
    NzRadioModule,
    NzModalModule,
    NzFormModule,
    ReactiveFormsModule,
    NzSelectModule,
    NzMessageModule,
    NzToolTipModule,
    NzTimelineModule,
    NzCollapseModule,
    NzTreeModule,
    NzTreeSelectModule,
    NzSwitchModule,
    ApiModule
    // ApiModule.forRoot((): Configuration=>{
    //   const params: ConfigurationParameters = {
    //     basePath: "http://localhost:8091/api"
    //   }
    //   return new Configuration(params);
    // })
  ],
  providers: [
    { provide: NZ_I18N, useValue: zh_CN },
    { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true },
    { provide: BASE_PATH, useValue: 'http://localhost:8091/api' },
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}

